
<template>
  <basic-container>
    <div class="title">{{currentTableName}}</div>
    <TempData
      v-if="target"
      :currentTable="target.verfiyConfirmFlag"
      @close="$emit('close')"
      :query="{ importCreatorId: target.creatorId, importTime: target.importTime, beginTime:target.beginTime, endTime:target.endTime }"
      mode="preview"
    />
  </basic-container>
</template>

<script>
import { fetchList, tables } from "@/api/rca/swckbankverifypayment";
import { dateFormat } from '@/util/date'
import { mapGetters } from "vuex";
import TempData from "./TempData";

export default {
  name: "swckbankverifypayment",
  components: {
    TempData,
  },
  data () {
    return {
      tableOptions: [],
    };
  },
  props: ["target"],
  computed: {
    ...mapGetters(["permissions"]),
    currentTableName () {
      const { target, tableOptions } = this;
      const table = tableOptions.find(table => table.verfiyConfirmFlag === target.verfiyConfirmFlag);
      return table && table.verifyConfirmName
    },
    permissionList () {
      return {
        addBtn: this.vaildData(
          this.permissions.generator_swckbankverifypayment_add,
          false
        ),
        delBtn: this.vaildData(
          this.permissions.generator_swckbankverifypayment_del,
          false
        ),
        editBtn: this.vaildData(
          this.permissions.generator_swckbankverifypayment_edit,
          false
        ),
      };
    },
  },
  created () {
    this.loadTables();
  },
  methods: {
    async loadTables () {
      const {
        data: { data },
      } = await tables.all({});
      this.tableOptions = data;
    },
  },
};
</script>
<style scoped lang="scss">
.table-opt {
  margin-left: 0;
  margin-right: 20px;
  margin-bottom: 20px;
}
.title {
  line-height: 30px;
  border-left: 2px solid blue;
  padding: 0 20px;
  margin-bottom: 30px;
}
</style>
